package com.legna.mhxy.support.controller;

import com.legna.mhxy.support.service.ImportService;
import com.legna.mhxy.support.utils.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@Tag(name="导入管理")
@RestController
@RequestMapping("/import")
@AllArgsConstructor
public class ImportController {

    private final ImportService importService;

    @GetMapping("/ring")
    @Operation(summary = "导入环")
    public Result<String> importRing(MultipartFile file) throws IOException {
        importService.importExcel(file);
        return Result.ok();
    }
}
